package com.gitee.wsl.mathematics.matrix.mat3.ext


import com.gitee.wsl.mathematics.matrix.mat3.Matrix3
import com.gitee.wsl.mathematics.matrix.mat3.MutableMatrix3
import com.gitee.wsl.mathematics.vector.vec3.Vector3

val <T:Number,V: Matrix3<T, V, R>,R: Vector3<T, R>> Matrix3<T, V,R>.transpose
    get() = copy(
        m01 = this.m10,
        m10 = this.m01,
        m02 = this.m20,
        m20 = this.m02,
        m12 = this.m21,
        m21 = this.m12
        )


fun<T:Number> MutableMatrix3<T, *,*>.transpose() {
    var d = m10
    m10 = m01
    m01 = d
    d = m20
    m20 = m02
    m02 = d
    d = m21
    m21 = m12
    m12 = d

    /*
    M[0,1] swap M[1,0]
    M[0,2] swap M[2,0]
    M[1,2] swap M[2,1]
    */

}
